﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECRMS.WinForm.WinService;
using ECRMS.WinForm.Modules;

namespace ECRMS.WinForm.BaseClass.Common
{
    public class Post
    {
        public List<CtPost> Posts;
        public CtPost OperatorRow;

        public FuncResult GetPosts(Guid corpId)
        {
            using (var ser = new ECRServiceClient())
            {
                CtServiceResultOfArrayOfCtPostOUJwPUXg result = ser.CtGetPosts(corpId);

                if (result.Status == 1)
                {
                    this.Posts = result.Data;
                }
                return new FuncResult
                {
                    Message = result.Message,
                    Status = result.Status
                };
            }
        }

        public FuncResult UpdatePost()
        {
            using (var ser = new ECRServiceClient())
            {
                CtServiceResult result = ser.CtUpdatePost(OperatorRow);

                return new FuncResult
                {
                    Message = result.Message,
                    Status = result.Status
                };
            }
        }



    }
}
